<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /**
     * 浅拷贝：拷贝的是地址
     * 深拷贝：拷贝的是完整对象
     *  通过JSON.parse(JSON.stringify(zhangsan))实现
     */
    const zhangsan = {
        name: '张三',
        age: 23,
        hobby: ['乒乓球', '足球'],
        family: {
            baby: '小张三',
            wife: "李四"
        }
    }
    let copyzhangsan = JSON.parse(JSON.stringify(zhangsan));
    console.log(zhangsan);
    console.log(copyzhangsan)


</script>
</body>
</html>